from PyQt5.QtCore import QThread, pyqtSignal

from utils.csi_detail import CSI_Detail, getDetail
from utils.csi_read import read_from_csifile


class OpenThread(QThread):
    opencomplete = pyqtSignal()

    def __init__(self, path):
        super(OpenThread, self).__init__()
        self.path = path


    def run(self):
        self.detail = self.openCSIData(self.path)
        self.opencomplete.emit()


    def openCSIData(self, path):
        csi_data = read_from_csifile(path)
        csi_detail = getDetail(csi_data)
        return csi_detail
